Accusoft.ImagXpress12.Net
Remove Redeye
See Also Send Feedback
ImagXpress 12 for .NET - User Guide > How To > Process an Image > Remove Redeye

Glossary Item Box

To reduce the red reflection of the flash seen in the eyes of people in color flash photo images, use one of the following Processor methods: 

Manual Red Eye Removal

Manually remove redeye from eyes in the image, using the RemoveRedeye method.

You must define an area to be processed, using the SetArea method prior to using the RemoveRedeye method.

Automatic Red Eye Removal

Automatically remove redeye from eyes in the image, using the AutoRemoveRedeye method. 

The AutoRemoveRedeye method will accurately correct red eyes without modifying elements in the photo which are not eyes, in most cases without any intervention.  

Optimized Red Eye Removal

As with any algorithm, there is a potential for false positives (modifications of areas that are not eyes), or red eyes that are not corrected in some images.

To provide the application with maximum control over this behavior, the AutoRemoveRedeye method returns all areas that have been corrected as a collection of rectangles. The rectangles identify areas in which red-eyes were detected and corrected and a value indicating the confidence that the area corrected was a red eye. This enables the application to set an acceptable level of false positives and optimize red-eye correction.

For example, an application could do the following: 

1. Enable the undo method by setting ImageX.UndoEnabled = True.

2. Correct redeyes, by calling Processor.AutoRemoveRedeye, specifying desired eyeshade, desired eye glare and setting UseEditRectangles to False. (When UseEditRectangles is True, previously detected rectangles will be used to correct red eyes. When UseEditRectangles is False, existing rectangles are ignored.)  The AutoRemoveRedeye method removes red eyes from the image and sets the rectangles property to the collection of rectangles in which red eyes were detected and corrected.  

To correct redeyes without displaying the results, disable paint by setting ImageX.AutoInvalidate = False prior to calling Processor.AutoRemoveRedeye.

3. Search and reverse any false positives

A. Enumerate through the collection of rectangles, starting at "1" through Processor.Redeyes.Count.

B. Determine if a rectangle erroneously identified an area as containing red eyes, either by visual inspection or by determining that confidence values are below the desired threshold. 

This threshold could be set by either the application end-user or the application programmer.

  • If the goal is to minimize false positives (modification of areas that aren't red eyes), keep only rectangles that have a very high confidence level. This will result in fewer red-eyes that are corrected, but may reduce the false positives.
  • If the goal is to maximize the number of red-eyes corrected, keep rectangles with a lower confidence level as well. This will result in more red-eyes corrected, but may increase the false positives.

C. Call Processor.Redeyes.RemoveRectangle to delete rectangles associated with any regions that should NOT be corrected.

4. Add red eyes that were not automatically corrected, if any, as follows:

A. Identify any remaining red eyes (visually).

B. Draw a rectangle around the remaining eyes. (Use rubberband, region, or area).

C. Add the rectangle to the rectangle collection, by calling Processor.Redeyes.

5. Modify redeye regions size or position, using the properties within the RedeyeRectangle class.

6. Correct red-eyes and display the image as follows:

A. Undo the previous AutoRemoveRedeye by calling Processor.ImageX.Undo.

B. Enable painting, by setting ImageX.AutoInvalidate = True

C. Correct redeyes, by calling Processor.AutoRemoveRedeye, setting UseEditRectangles to True. 

 

See Also

©2013. Accusoft Corporation. All Rights Reserved.